SET(API_HER)
FILE(GLOB_RECURSE API_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/api/*.h)

ADD_CUSTOM_TARGET(Doxy ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/html_en ${CMAKE_CURRENT_SOURCE_DIR}/html_cn)

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/html_en
    COMMAND doxygen Doxyfile_en
    DEPENDS ${API_HEADERS}
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/html_cn
    COMMAND doxygen Doxyfile_cn
    DEPENDS ${API_HEADERS}
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/html_en ${CMAKE_CURRENT_SOURCE_DIR}/html_cn
    DESTINATION ${CMAKE_INSTALL_PREFIX}/doc
)
